package com.pvdnc.encrypt;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Objects;

public class MD5 {
    private static MessageDigest getMD5Digest(){
        try {
            return MessageDigest.getInstance("MD5");
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
            return null;
        }
    }

    public static byte[] get(String str){
        MessageDigest digest= Objects.requireNonNull(getMD5Digest());
        return digest.digest(str.getBytes());
    }
}
